{% extends "admin/admin.html" %}
{% block content %}
{% import "includes/paginate.html" as pg %}
    <!--内容-->
    <section class="content-header">
        <h1>小电影管理系统</h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 时间轴管理</a></li>
            <li class="active">电影时间轴列表</li>
        </ol>
    </section>
    <section class="content" id="showcontent">
        <div class="row">
            <div class="col-md-12">
                <div class="box box-primary">
                    <div class="box-header">
                        <h3 class="box-title">电影时间轴列表</h3>
                        <div class="box-tools">
                            <div class="input-group input-group-sm" style="width: 150px;">
                                <input type="text" name="table_search" class="form-control pull-right"
                                       placeholder="请输入关键字...">
                                <div class="input-group-btn">
                                    <button type="submit" class="btn btn-default"><i class="fa fa-search"></i>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="box-body table-responsive no-padding">
                        {% for msg in get_flashed_messages(category_filter=["OK"]) %}
                            <div class="alert alert-success alert-dismissible" role="alert">
                                <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                    <span aria-hidden="true">&times;</span>
                                </button>
                                <h4 class="alert-heading"><i class="icon fa fa-check"></i>删除标签成功</h4>
                                {{ msg }}
                            </div>
                        {% endfor %}
                        <table class="table table-hover">
                            <tbody>
                            <tr>
                                <th>编号</th>
                                <th>标签</th>
                                <th>标题</th>
                                <th>上映时间</th>
                                <th>视频地址</th>
                                <th>图片地址</th>
                            </tr>
                            {% for p in page_num.items %}
                                <tr>
                                    <td>{{ p.id }}</td>
                                    <td>{{ p.tag }}</td>
                                    <td>{{ p.title }}</td>
                                    <td>{{ p.add_time }}</td>
                                    <td>{{ p.url }}</td>
                                    <td>{{ p.imgUrl }}</td>
                                    <td>
                                        <a href="{{ url_for('admin.timeline_edit', id=p.id) }}" class="label label-success">编辑</a>
                                        &nbsp;
                                        <a href="{{ url_for('admin.timeline_del', id=p.id) }}" class="label label-danger">删除</a>
                                    </td>
                                </tr>
                            {% endfor %}
                            </tbody>
                        </table>
                    </div>
                    <div class="box-footer clearfix">
                        {{ pg.page(page_num, 'admin.timeline_list') }}
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!--内容-->
{% endblock %}

{% block js %}
    <script>
        $(document).ready(function () {
            $("#g-12").addClass("active");
            $("#g-12-2").addClass("active");
        })
    </script>
{% endblock %}